﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Linq;

namespace Winnow.SharepointDesigner.Controls
{
    public class XMLParser : Control
    {
        private String _xml = "<root/>";

        public virtual String XML
        {
            get
            {
                return _xml;
            }
            set
            {
                _xml = value;
            }
        }

        protected override void CreateChildControls()
        {
            Panel pnlRoot = new Panel();
            try
            {
                XDocument xDoc = XDocument.Parse("<Form Type=\"DisplayForm\" Name=\"{78A212C8-C91E-4C0A-89A6-A6A8620A3975}\" Url=\"/MyTeamSite/team3/Lists/Announcements/DispForm.aspx\" Default=\"TRUE\" FormID=\"0\" />");
               
            }
            catch (Exception ex)
            {
                pnlRoot.Controls.Add(new Label() { Text = ex.Message });
            }

            Controls.Add(pnlRoot);

        }

    }
}
